package com.lizicloud.user.userRegister.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;

/**
 * 用户注册数据传输对象
 */
@Data
@Schema(description = "用户注册请求")
public class RegisterDTO {
    
    @NotBlank(message = "用户账号不能为空")
    @Size(min = 3, max = 20, message = "用户账号长度必须在3-20位之间")
    @Pattern(regexp = "^[a-zA-Z0-9_]+$", message = "用户账号只能包含字母、数字和下划线")
    @Schema(description = "用户账号", example = "user123")
    private String useraccount;
    
    @NotBlank(message = "用户名不能为空")
    @Size(min = 2, max = 20, message = "用户名长度必须在2-20位之间")
    @Schema(description = "用户名", example = "张三")
    private String username;
    
    @NotBlank(message = "密码不能为空")
    @Size(min = 6, max = 20, message = "密码长度必须在6-20位之间")
    @Pattern(regexp = "^(?=.*[a-zA-Z])(?=.*\\d).+$", message = "密码必须包含字母和数字")
    @Schema(description = "密码", example = "password123")
    private String password;
    
    @Schema(description = "用户角色", example = "USER", defaultValue = "USER")
    private String role = "USER";
}